* {
  padding: 0;
  margin: 0;
  list-style: none;
  text-decoration: none;
  font-family: Consolas, "Helvetica Neue", Helvetica, Arial, sans-serif;
  line-height: 1.6;
  letter-spacing: 0.05em;
}

$basic_color: #45b787;
$basic_hover_color: #2c9678;
.ym-btn {
  display: inline-block;
  text-align: center;
  padding: 0.5em 1em;
  font-size: 90%;
  text-decoration: none;
  user-select: none;
  zoom: 1;
  border: transparent;
  border-radius: 4px;
  cursor: pointer;
  color: #fff;
  outline: none;

  &-xsmall {
    font-size: 70%;
  }

  &-small {
    font-size: 80%;
  }

  &-large {
    font-size: 100%;
  }

  &-xlarge {
    font-size: 110%;
  }
}

.ym-btn.ym-btn-disabled {
  background-color: #dddddd;
  color: #444444;
  cursor: not-allowed;
  opacity: .7;
}

$color_name: yellow orange red purple blue green cyan gray;
$color_list: #f8df70 #f97d1c #de1c31 #813c85 #2775b6 #45b787 #1a94bc #bbb5ac;
$color_list_deep: #fecc11 #f86b1d #f43e06 #7e1671 #0f59a4 #2c9678 #1772b4 #867e76;
@each $name in $color_name {
  $i: index($color_name, $name);
  .ym-btn-#{$name} {
    background-color: nth($color_list, $i);

    &:hover,
    &.active {
      background-color: nth($color_list_deep, $i);
    }
  }
  .color-#{$name} {
    color: nth($color_list, $i);
  }
  .backcolor-#{$name} {
    background-color: nth($color_list, $i);
  }
  .bordercolor-#{$name} {
    border-color: nth($color_list, $i);
  }
}

.ym-form {
  input[type=password],
  input[type=email],
  input[type=url],
  input[type=date],
  input[type=month],
  input[type=time],
  input[type=datetime],
  input[type=datetime-local],
  input[type=week],
  input[type=tel],
  input[type=color],
  input[type=number],
  input[type=search],
  input[type=text],
  select,
  textarea {
    font-size: 90%;
    padding: .5em .6em;
    display: block;
    border: 1px solid #ccc;
    box-shadow: inset 0 1px 1px #ddd;
    border-radius: 4px;
    vertical-align: middle;
    box-sizing: border-box;
    outline: none;
    transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;

    &:focus {
      border-color: $basic_color;
      box-shadow: inset 0 1px 1px #ddd, 0 0 5px $basic_hover_color;
    }
  }

  label {
    display: block;
    margin: .25em 0;
  }

  select {
    height: 2.25em;
  }

  .ym-checkbox {
    margin: .2em 0;
  }
}

.ym-form.ym-form-inline {
  input[type=password],
  input[type=email],
  input[type=url],
  input[type=date],
  input[type=month],
  input[type=time],
  input[type=datetime],
  input[type=datetime-local],
  input[type=week],
  input[type=tel],
  input[type=color],
  input[type=number],
  input[type=search],
  input[type=text],
  select,
  textarea {
    display: inline-block;
    margin-right: 5px;
  }

  label {
    display: inline-block;
  }
}

.ym-form.ym-form-align {
  .ym-group {
    margin-bottom: .5em;

    label {
      width: 10em;
      text-align: right;
      margin-right: 1em;
    }
  }

  .ym-control {
    margin: 1.5em 0 0 11em;
  }

  .ym-checkbox {
    display: block;
  }
}

/**弹窗**/
.ym-dialog-container {
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;

  .ym-dialog-cover {
    position: absolute;
    z-index: 0;
    background: rgba(0, 0, 0, 0.7);
    width: 100%;
    height: 100%;
  }

  .ym-dialog-main {
    z-index: 1;
    border-radius: 5px;
    min-width: 25em;
    overflow: hidden;
    position: absolute;

    .title {
      padding: 0.5em 1em;
      color: #ffffff;
      position: relative;
      cursor: move;

      .x-close {
        position: absolute;
        width: 1em;
        height: 1em;
        right: .8em;
        top: .8em;
        font-size: 100%;
        cursor: pointer;

        em {
          background-color: #ffffff;
          width: 18px;
          height: 2px;
          position: absolute;
          top: .5em;
          left: 0;
          transform: rotateZ(45deg);

          &::before {
            content: " ";
            display: block;
            width: 2px;
            height: 18px;
            background-color: #ffffff;
            top: -8px;
            left: 8px;
            position: absolute;
          }

        }
      }


    }

    .content {
      background-color: #ffffff;
      padding: 1em;
      border-width: 0 0 1px 0;
      border-style: solid;
      max-height: 80vh;
      overflow: auto;
    }

    .btn-area {
      background-color: #ffffff;
      padding: .5em;
      display: flex;
      justify-content: flex-end;

      .ym-btn {
        margin-left: 5px;
      }
    }
  }
}

/**布局**/
.ym-row {
  width: 100%;

  &::after {
    content: "";
    display: block;
    clear: both;
    width: 0;
    height: 0;
  }

  [class*="ym-col"] {
    float: left;
  }

  .ym-col-1 {
    width: 8.33%;
  }

  .ym-col-2 {
    width: 16.66%;
  }

  .ym-col-3 {
    width: 25%;
  }

  .ym-col-4 {
    width: 33.33%;
  }

  .ym-col-5 {
    width: 41.66%;
  }

  .ym-col-6 {
    width: 50%;
  }

  .ym-col-7 {
    width: 58.33%;
  }

  .ym-col-8 {
    width: 66.66%;
  }

  .ym-col-9 {
    width: 75%;
  }

  .ym-col-10 {
    width: 83.33%;
  }

  .ym-col-11 {
    width: 91.66%;
  }

  .ym-col-12 {
    width: 100%;
  }
}

.ym-stream {
  display: flex;

  &.stream-row {
    flex-direction: column;
  }

  .ym-auto-width {
    flex-grow: 1;
  }
}

/**表格**/
.ym-table {
  border: 1px solid $basic_color;
  border-spacing: 0;
  color: #444444;

  thead {
    background-color: $basic_color;
    color: #ffffff;
  }

  th, td {
    padding: .5em 1em;
  }

  &.ym-table-verb {
    th, td {
      border-left: 1px solid $basic_hover_color;

      &:first-child {
        border-left: 0;
      }
    }
  }

  &.ym-table-horb {
    th, td {
      border-bottom: 1px solid $basic_hover_color;
    }

    tr:last-child {
      td {
        border-bottom: 0;
      }
    }
  }

  &.ym-table-stripe {
    tbody tr:nth-child(even) {
      background-color: #dfecd5;
    }
  }

}

/**分页**/
.ym-page-group {
  font-size: 95%;
  ul {
    display: flex;
    flex-direction: row;
    float: left;

    li {
      border: 1px solid $basic_color;
      color: $basic_color;
      padding: 0.4em .8em;
      margin: 0 .2em;
      cursor: pointer;
      &.can-click:hover {
        background-color: $basic_color;
        color: #ffffff;
      }
      &.active {
        background-color: $basic_color;
        color: #ffffff;
      }
      &.dont-click {
        border: 0;
        cursor: default;
      }
    }

  }

  .page-search {
    color: $basic_color;
    margin-left: 1em;
    float: left;

    input {
      font-size: 95%;
      width: 3em;
      padding: .4em 0;
      display: inline-block;
      text-align: center;
      border: 1px solid $basic_color;
      outline: none;
      transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;

      &:focus {
        border-color: #45b787;
        box-shadow: inset 0 1px 1px #ddd, 0 0 5px #2c9678;
      }
    }

    button {
      margin-left: 1em;
    }
  }

  &::after {
    content: "";
    display: block;
    clear: both;
  }
}

/** 提示框 **/
.ym-tip-container {
  position: fixed;
  z-index: 9999;
  padding: .3em .5em;
  background-color: $basic_color;
  color: #ffffff;
  visibility: hidden;
  span {
    position: absolute;
    width: 0;
    height: 0;
    border-width: 5px;
    border-style: solid;
  }
  &.pos-left span {
    border-width: 5px 0 5px 5px;
    border-color: transparent transparent transparent $basic_color;
    right: -5px;
    top: 50%;
    margin-top: -5px;
  }
  &.pos-right span {
    border-width: 5px 5px 5px 0;
    border-color: transparent $basic_color transparent transparent;
    left: -5px;
    top: 50%;
    margin-top: -5px;
  }
  &.pos-up span {
    border-width: 5px 5px 0 5px;
    border-color: $basic_color transparent transparent transparent;
    bottom: -5px;
    left: .5em;
  }
  &.pos-bottom span {
    border-width: 0 5px 5px 5px;
    border-color: transparent transparent $basic_color transparent;
    top: -5px;
    left: .5em;
  }
}

/**carousel**/
.ym-carousel-container {
  display: block;
  overflow: hidden;
  position: relative;
  .ym-carousel {
    display: flex;
    flex-direction: row;
    transition: left 1.5s ease-in-out;
    position: absolute;
    z-index: 1;
    left: 0;
    top: 0;
  }
  .ym-carousel-point.hover-hide {
    display: none;
  }
  &:hover .ym-carousel-point.hover-hide {
    display: flex;
  }
  .ym-carousel-point {
    position: absolute;
    z-index: 2;
    flex-direction: row;
    bottom: 20px;
    right: 20px;
    display: flex;
    li {
      width: 10px;
      height: 10px;
      background-color: #ffffff;
      margin: 0 5px;
      cursor: pointer;
      transition: background-color 1.5s ease-in-out;
      &.active {
        background-color: $basic_hover_color;
      }
    }
  }
  .ym-carousel-btn.hover-hide {
    display: none;
  }
  &:hover .ym-carousel-btn.hover-hide {
    display: block;
  }
  .ym-carousel-btn {
    font-size: 200%;
    position: absolute;
    z-index: 2;
    width: 1.6em;
    height: 1.6em;
    text-align: center;
    line-height: 1.6em;
    color: #ffffff;
    background-color: $basic_color;
    opacity: .7;
    top: 50%;
    border-radius: 1em;
    margin-top: -.8em;
    cursor: pointer;
    display: block;
    font-weight: bold;
    &:hover {
      opacity: 1;
    }
    &.left {
      left: 20px;
    }
    &.right {
      right: 20px;
    }
  }
}